import Tab from './Tab'
import { reactive, computed, readonly } from 'vue'
export interface State {
  readonly tabs: Tab[]
  tabIndex: number
  isMaximized: boolean
  isFullScreen: boolean
  homeTabs: { url: string; webSecurity: boolean; nodeIntegration: boolean }[]
  readonly curTab: Tab
}

export const state: State = reactive({
  tabs: [],
  tabIndex: -1,
  isMaximized: false,
  isFullScreen: false,
  homeTabs: [
    {
      url: 'https://www.baidu.com/',
      webSecurity: true,
      nodeIntegration: false
    }
  ],
  curTab: computed(() => {
    return state.tabs[state.tabIndex]
  })
})
